package yannan.voiplock4ble.bean.ble;

import yannan.voiplock4ble.utils.ByteUtils;

/**
 * 说明：添加指静脉
 * 作者：mainTel
 * 时间：2016/12/6 14:10
 * 备注：
 */
public class AddVein extends BaseBleResponse {

    /*
    //注册指静脉应答
typedef struct {
	AppCommandHead_T head;
	uint8_t cmd;
	uint8_t reserve;	//对齐保留
	uint16_t token;
//指静脉注册返回码
#define FINGER_REGISTER_NOT_EXCEPT		0		//无异常
#define FINGER_NUM_REACH_MAX			1		//指静脉用户个数已达到最大
#define FINGER_VERIFY_OK			2		//权限认证成功
#define VERIFY_ADMIN_AUTHORITY_FAILURE		3		//权限认证失败
#define FINGER_PHONE_HAVE_EXISTED		4		//手机号已经存在
#define FINGER_REGISTER_FAILURE			5		//指静脉注册失败
	uint16_t registerResult;			//注册返回码
	uint8_t templateGroupId;
	uint8_t templateId;
	uint32_t timeStamp;
}FingerRegisterRsp_T;
5A A5 10 00 00 00 0B 00 45 A0 02 00 00 00 00 00 00 00 BF 1A
5A A5 10 00 00 00 0B 00 45 A0 00 00 00 05 8E 56 46 58 D5 59
     */

    public final static int FINGER_REGISTER_NOT_EXCEPT = 0;
    public final static int FINGER_NUM_REACH_MAX = 1;
    public final static int FINGER_VERIFY_OK = 2;
    public final static int VERIFY_ADMIN_AUTHORITY_FAILURE = 3;
    public final static int FINGER_PHONE_HAVE_EXISTED = 4;
    public final static int FINGER_REGISTER_FAILURE = 5;

    public int registerResult;
    public int templateGroupId;
    public int templateId;
    public int timeStamp;

    public AddVein(byte[] response) {
        super(response);
        registerResult = content[0] & 0xff;
        templateGroupId = content[2] & 0xff;
        templateId = content[3] & 0xff;
        timeStamp = ByteUtils.byte2int(new byte[]{content[4],content[5],content[6],content[7]});
    }
}
